﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SLExcel
{
    public class TextBoxNoFocus : TextBox
    {
        public override void OnApplyTemplate()
        {
            foreach (string s in "FocusVisualElement,MouseOverBorder".Split(','))
            {
                var bdr = GetTemplateChild(s) as Border;
                if (bdr != null)
                {
                    bdr.BorderThickness = new Thickness(0);
                }
            }
            base.OnApplyTemplate();
        }
    }

}
